#define _CRT_SECURE_NO_WARNINGS 1
//#include<stdio.h>
//int main() {
//    int men, women, chid, n=45;
//    for (men = 0; men <= n; men++)
//    {
//        for (women = 0; women <= n; women++)
//        {
//            for (chid = 0; chid <= n; chid += 2)
//            {
//                if (women + men + chid == n && 3 * men + 2 * women + chid / 2 == n)
//                {
//                    printf("men = %d, women = %d, child = %d\n", men, women, chid);
//                }
//            }
//        }
//    }
//    return 0;
//}
//int main()
//{
//	int men = 0;
//	int women = 0;
//	int child = 0;
//	int brick = 45;
//	for (men = 0; men <= 15; men++)
//	{
//		for (women = 0; women <= 23; women++)
//		{
//			child = 45 - men - women;
//			if (3 * men + 2 * women + child / 2 == 45)
//				printf("men=%d,women=%d,child=%d\n", men, women, child);
//		}
//	}
//	return 0;
//}

#include <stdio.h>
int main()
{
	int men = 0;
	int women = 0;
	int child = 0;
	int brick = 45;
	for (men = 0; men <= 15; men++)
	{
		for (women = 0; women <= 23; women++)
		{
			child = 45 - men - women && child % 2 == 0;
			if (3 * men + 2 * women + child / 2 == 45)
				printf("men=%d,women=%d,child=%d\n", men, women, child);
		}
	}
	return 0;
}